package com.symbio.ishenapi.order.controller;

import com.jfinal.plugin.activerecord.Record;
import com.symbio.ishenapi.common.controller.BaseController;
import com.symbio.ishenapi.order.model.TmOrderDictionary;
import io.jboot.web.controller.annotation.RequestMapping;

import java.util.List;

/**
 * @Author: chen
 * @Description:医生字典类控制层
 * @Date: Created in 16:24 2018/10/31
 * @Modified By:
 */
@RequestMapping("TmOrderDictionary")
public class TmOrderDictionaryController extends BaseController{

    /**
     * 获取医生的字典类型
     */
    public void findByType(){
        String type = getPara("type");
        try {
            List<Record> data = TmOrderDictionary.dao.findByType(type);
            renderJson(data);
        }catch (Exception e){
            renderJsonError(40005,"字典查询出错");
        }
    }

    /**
     * 获取订单类型
     */
    public void getOrderType(){
        TmOrderDictionary tmOrderDictionary = (TmOrderDictionary)getReqBodyObject(TmOrderDictionary.class);
        try {
            List<TmOrderDictionary> data = TmOrderDictionary.dao.getOrderType(tmOrderDictionary);
            renderJson(data);
        }catch (Exception e){
            renderJsonError(40005,"查询订单类型出错");
        }
    }

    /**
     * 获取套餐类型
     */
    public void getOrderServiceType(){
        TmOrderDictionary tmOrderDictionary = (TmOrderDictionary)getReqBodyObject(TmOrderDictionary.class);
        try {
            List<TmOrderDictionary> data = TmOrderDictionary.dao.getOrderServiceType(tmOrderDictionary);
            renderJson(data);
        }catch (Exception e){
            renderJsonError(40005,"查询订单类型出错");
        }
    }
}
